package auth

type Role struct {
	Name  string
	Perms []string
}

var roles = map[string]Role{
	"admin": {"admin", []string{"read", "write", "delete"}},
	"user":  {"user", []string{"read"}},
}

func CheckPermission(role string, permission string) bool {
	for _, perm := range roles[role].Perms {
		if perm == permission {
			return true
		}
	}
	return false
}
